package net.xju.service.impl;

import net.xju.common.utils.PageInfo;
import net.xju.dao.UserDao;
import net.xju.entity.User;
import net.xju.service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    UserDao userDao = new UserDao();
    @Override
    public List<User> list() {
        // 业务层-》持久层
        List<User> userList =  userDao.list();
        return userList;
    }

    @Override
    public User login(String username, String password) {
        return userDao.login(username,password);  // alt+enter
    }

    @Override
    public void insert(User user) {
        userDao.insert(user);
    }

    @Override
    public Boolean update(User user) {
       return userDao.update(user);
    }

    @Override
    public User selectById(int id) {
        return userDao.selectById(id);
    }

    @Override
    public boolean deleteById(int id) {
        return userDao.deleteById(id);
    }

    @Override
    public PageInfo<User> pageList(String username, String gender, Integer pageNo, Integer pageSize) {
        return userDao.pageList(username,gender,pageNo,pageSize);
    }
}
